﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Master.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<CourseManager.Domain.Entities.Student>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	GetStudentByName
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
    <script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../../Scripts/Index.js" type="text/javascript"></script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
      <%using(Html.BeginForm("GetStudentByName", "Student",FormMethod.Post))
  { %>
<div id="content"">
    <div style=" background-color:#ffffff">
    <br />
        <table style=" margin-left:200px;">
            <tr>
                <td><strong>Student Name:</strong></td>
                <td><input style=" width:240px;" type="text" id="StudentName" name="StudentName" />  <strong><%: Html.ValidationMessage("StudentName", "Campo Requerido")%></strong></td>
            </tr>
            <tr>
                <td colspan="2"><input style=" margin-left:200px;" type="submit" id="BtnSearch" value="Search" /></td>
            </tr>
        </table>
    </div>  
</div>
<%} %>
</asp:Content>

<asp:Content ID="Content4" runat="server" contentplaceholderid="Result">
    <h3 style=" color:#FFFFFF;">Results</h3>
    <div style=" background-color:#ffffff">
    <br />
        <div id="Results">
            <div>
                   <% if (Model != null)
                      {%>
                  <table style=" margin-left:200px;">
                    <thead>
                        <tr style=" background-color:#4d6bb3;">
                            <td style="color:#ffffff"><strong>Id</strong></td>
                            <td style="color:#ffffff"><strong>Name</strong></td>
                            <td style="color:#ffffff"><strong>Last Name</strong></td>
                            <td style="color:#ffffff"><strong>Telephone</strong></td>
                            <td style="color:#ffffff"><strong>Cellphone</strong></td>
                            <td style="color:#ffffff"><strong>Insterest</strong></td>
                            <td style="color:#ffffff"><strong>Details</strong></td>
                            <td style="color:#ffffff"><strong>Delete</strong></td>
                        </tr>
                </thead>
                <tbody>    
                    <%foreach (var item in Model)
                      {%>
                    <tr >
                        <td><%: item.Id%></td>
                        <td><%: item.Name%></td>
                        <td><%: item.LastName%></td>
                        <td><%: item.Telephone%></td>
                        <td><%: item.Cellphone%></td>
                        <td><%: item.Insterest%></td>
                        <td><%: Html.ActionLink("Details", "Details", new { pId = item.Id }, new { @class = "DetailStudent" })%></td>
                        <td><%: Html.ActionLink("Delete", "DeleteStudent", new { pId = item.Id }, new {@class = "DeleteStudent" })%></td>
                    </tr>
                    <%} %>
                </tbody>
            </table>
            <%} %>
                        
            <br />
        </div>
    </div>
 </div>
  <br />
  <h3 style=" color:#FFFFFF;">Actions</h3>
  <div id="Actions" style=" background-color:#FFFFFF;">
        <%: Html.ActionLink("Agregar Estudiante","AddStudent","Student") %>
       |
        <%:Html.ActionLink("Agregar Instructor","AddInstructor","Instructor")%>
       |
        <%:Html.ActionLink("Buscar Instructor", "GetInstructor", "Instructor")%>
  </div>
</asp:Content>








